id: currentAccountStatusIndicatorBackground
visible: UserModel.currentUser && UserModel.currentUser.isConnected
&& UserModel.currentUser.serverHasUserStatus
+ && UserModel.currentUser.status !== UserStatus.Invisible
+ && UserModel.currentUser.status !== UserStatus.Offline
width: Style.accountAvatarStateIndicatorSize + + Style.trayFolderStatusIndicatorSizeOffset
height: width
- color: root.parentBackgroundColor
+ color: "white"
anchors.bottom: currentAccountAvatar.bottom
anchors.right: currentAccountAvatar.right
radius: width * Style.trayFolderStatusIndicatorRadiusFactor
id: currentAccountStatusIndicator
visible: UserModel.currentUser && UserModel.currentUser.isConnected
&& UserModel.currentUser.serverHasUserStatus
+ && UserModel.currentUser.status !== UserStatus.Invisible
+ && UserModel.currentUser.status !== UserStatus.Offline
source: UserModel.currentUser ? UserModel.currentUser.statusIcon : ""
cache: false
x: currentAccountStatusIndicatorBackground.x + 1
visible: model.isConnected && model.serverHasUserStatus\r
width: accountStatusIndicator.sourceSize.width + 2\r
height: width\r
+ color: "white"\r
anchors.bottom: accountAvatar.bottom\r
anchors.right: accountAvatar.right\r
- radius: width * Style.trayFolderStatusIndicatorRadiusFactor\r
+ radius: width * Style.trayFolderStatusIndicatorRadiusFactor\r
}\r
\r
Image {\r
});
connect(u, &User::statusChanged, this, [this, row] {
- emit dataChanged(index(row, 0), index(row, 0), {UserModel::StatusIconRole,
- UserModel::StatusEmojiRole,
+ emit dataChanged(index(row, 0), index(row, 0), {UserModel::StatusRole,
+ UserModel::StatusIconRole,
+ UserModel::StatusEmojiRole,
UserModel::StatusMessageRole});
});
return _users[index.row()]->server();
} else if (role == ServerHasUserStatusRole) {
return _users[index.row()]->serverHasUserStatus();
+ } else if (role == StatusRole) {
+ return QVariant::fromValue(_users[index.row()]->status());
} else if (role == StatusIconRole) {
return _users[index.row()]->statusIcon();
} else if (role == StatusEmojiRole) {
roles[NameRole] = "name";
roles[ServerRole] = "server";
roles[ServerHasUserStatusRole] = "serverHasUserStatus";
+ roles[StatusRole] = "status";
roles[StatusIconRole] = "statusIcon";
roles[StatusEmojiRole] = "statusEmoji";
roles[StatusMessageRole] = "statusMessage";
Q_PROPERTY(QColor headerTextColor READ headerTextColor NOTIFY headerTextColorChanged)
Q_PROPERTY(QColor accentColor READ accentColor NOTIFY accentColorChanged)
Q_PROPERTY(bool serverHasUserStatus READ serverHasUserStatus CONSTANT)
+ Q_PROPERTY(UserStatus::OnlineStatus status READ status NOTIFY statusChanged)
Q_PROPERTY(QUrl statusIcon READ statusIcon NOTIFY statusChanged)
Q_PROPERTY(QString statusEmoji READ statusEmoji NOTIFY statusChanged)
Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY statusChanged)
NameRole = Qt::UserRole + 1,
ServerRole,
ServerHasUserStatusRole,
+ StatusRole,
StatusIconRole,
StatusEmojiRole,
StatusMessageRole,